package com.csproj.dispatch.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;


/**
 * 位置信息表
 */
@ApiModel(description = "位置信息表")
@Entity
@Table(name = "t_dis_position_info")
public class PositionInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "id")
    private String id;

    /**
     * 调度表主键
     */
    @ApiModelProperty(value = "调度表主键")
    @Column(name = "dispatch_id")
    private String dispatchId;

    /**
     * 当前位置
     */
    @ApiModelProperty(value = "当前位置")
    @Column(name = "currentpostion")
    private String currentpostion;

    /**
     * 上报时间
     */
    @ApiModelProperty(value = "上报时间")
    @Column(name = "report_time")
    private ZonedDateTime reportTime;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "creation_time")
    private ZonedDateTime creationTime;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDispatchId() {
        return dispatchId;
    }

    public PositionInfo dispatchId(String dispatchId) {
        this.dispatchId = dispatchId;
        return this;
    }

    public void setDispatchId(String dispatchId) {
        this.dispatchId = dispatchId;
    }

    public String getCurrentpostion() {
        return currentpostion;
    }

    public PositionInfo currentpostion(String currentpostion) {
        this.currentpostion = currentpostion;
        return this;
    }

    public void setCurrentpostion(String currentpostion) {
        this.currentpostion = currentpostion;
    }

    public ZonedDateTime getReportTime() {
        return reportTime;
    }

    public PositionInfo reportTime(ZonedDateTime reportTime) {
        this.reportTime = reportTime;
        return this;
    }

    public void setReportTime(ZonedDateTime reportTime) {
        this.reportTime = reportTime;
    }

    public ZonedDateTime getCreationTime() {
        return creationTime;
    }

    public PositionInfo creationTime(ZonedDateTime creationTime) {
        this.creationTime = creationTime;
        return this;
    }

    public void setCreationTime(ZonedDateTime creationTime) {
        this.creationTime = creationTime;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PositionInfo positionInfo = (PositionInfo) o;
        if (positionInfo.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), positionInfo.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "PositionInfo{" +
            "id=" + getId() +
            ", dispatchId='" + getDispatchId() + "'" +
            ", currentpostion='" + getCurrentpostion() + "'" +
            ", reportTime='" + getReportTime() + "'" +
            ", creationTime='" + getCreationTime() + "'" +
            "}";
    }
}
